/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author lomanda
 */
@Entity
@Table(name = "historicoSalario")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HistoricoSalario.findAll", query = "SELECT h FROM HistoricoSalario h"),
    @NamedQuery(name = "HistoricoSalario.findByIdSalario", query = "SELECT h FROM HistoricoSalario h WHERE h.idSalario = :idSalario"),
    @NamedQuery(name = "HistoricoSalario.findByValor", query = "SELECT h FROM HistoricoSalario h WHERE h.valor = :valor"),
    @NamedQuery(name = "HistoricoSalario.findByDetalhe", query = "SELECT h FROM HistoricoSalario h WHERE h.detalhe = :detalhe"),
    @NamedQuery(name = "HistoricoSalario.findByData", query = "SELECT h FROM HistoricoSalario h WHERE h.data = :data")})
public class HistoricoSalario implements Serializable {
    @Column(name = "data")
    @Temporal(TemporalType.DATE)
    private Date data;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idSalario")
    private Integer idSalario;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valor")
    private double valor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "detalhe")
    private String detalhe;
    @JoinColumn(name = "fkContrato", referencedColumnName = "idContrato")
    @ManyToOne(optional = false)
    private Contrato fkContrato;

    public HistoricoSalario() {
    }

    public HistoricoSalario(Integer idSalario) {
        this.idSalario = idSalario;
    }

    public HistoricoSalario(Integer idSalario, double valor, String detalhe) {
        this.idSalario = idSalario;
        this.valor = valor;
        this.detalhe = detalhe;
    }

    public Integer getIdSalario() {
        return idSalario;
    }

    public void setIdSalario(Integer idSalario) {
        this.idSalario = idSalario;
    }

    public double getValor() {
        return valor;
    }

    public void setValor(double valor) {
        this.valor = valor;
    }

    public String getDetalhe() {
        return detalhe;
    }

    public void setDetalhe(String detalhe) {
        this.detalhe = detalhe;
    }

    public Contrato getFkContrato() {
        return fkContrato;
    }

    public void setFkContrato(Contrato fkContrato) {
        this.fkContrato = fkContrato;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSalario != null ? idSalario.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistoricoSalario)) {
            return false;
        }
        HistoricoSalario other = (HistoricoSalario) object;
        if ((this.idSalario == null && other.idSalario != null) || (this.idSalario != null && !this.idSalario.equals(other.idSalario))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.HistoricoSalario[ idSalario=" + idSalario + " ]";
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }
    
}
